Update the error enum and the gtk_recent_manager_add and
authorEmmanuele Bassi <ebassi@cvs.gnome.org>
Fri, 12 May 2006 08:39:17 +0000 (08:39 +0000)
committerEmmanuele Bassi <ebassi@src.gnome.org>
Fri, 12 May 2006 08:39:17 +0000 (08:39 +0000)
2006-05-11  Emmanuele Bassi  <ebassi@cvs.gnome.org>

* gtk/tmpl/gtkrecentmanager.sgml: Update the error enum and the
gtk_recent_manager_add and gtk_recent_manager_add_full parameters.

* gtk/migrating-GtkRecentChooser.sgml: Mention
gtk_recent_manager_get_default() and update the code examples.

docs/reference/ChangeLog
docs/reference/gtk/migrating-GtkRecentChooser.sgml
docs/reference/gtk/tmpl/gtkrecentmanager.sgml

index 8e3a8911ab402120d8349ae57078cfaf018b86dc..7f2583e9d077eaad03db587f32f9f6303b0cd933 100644 (file)
@@ -1,3 +1,11 @@
+2006-05-11  Emmanuele Bassi  <ebassi@cvs.gnome.org>
+
+       * gtk/tmpl/gtkrecentmanager.sgml: Update the error enum and the
+       gtk_recent_manager_add and gtk_recent_manager_add_full parameters.
+
+       * gtk/migrating-GtkRecentChooser.sgml: Mention
+       gtk_recent_manager_get_default() and update the code examples.
+
 2006-05-09  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/gtk-sections.txt: Add gtk_message_dialog_set_image.
index 4f90c23b3fa8cee373c2fe77904b838ed50e3c6b..a8336431d32a2a89f192d56c68eeb2a5ddfc70ed 100644 (file)
       you of changes inside the list.
     </para>
 
+    <para>
+      Usually, instead of creating a new #GtkRecentManager each time you
+      need it, you'll want to use the gtk_recent_manager_get_default()
+      function.
+    </para>
+
     <para>
       To add a document to the list, you can use gtk_recent_manager_add_item(),
       like:
       <informalexample><programlisting>
         GtkRecentManager *manager;
-        GError *error = NULL;
 
        manager = gtk_recent_manager_new (<!-- -->);
 
-       gtk_recent_manager_add_item (manager, document_uri, &amp;error);
-       if (error)
+       if (!gtk_recent_manager_add_item (manager, document_uri))
          {
-           g_warning ("Unable to add '%s' to the list of recently used documents: %s\n",
-                      document_uri,
-                      error->message);
-            
-           g_error_free (error);
+           /* warn about the error */
          }
        
        g_object_unref (manager);
@@ -85,7 +85,6 @@
       <informalexample><programlisting>
         GtkRecentManager *manager;
         GtkRecentData *recent_data;
-       GError *error = NULL;
 
        manager = gtk_recent_manager_new (<!-- -->);
        
         */
        recent_data-&amp;app_exec = g_strjoin (" ", g_get_prgname (<!-- -->), "--open-file", "%u", NULL);
 
-       gtk_recent_manager_add_full (manager, document_uri, recent_data, &amp;error);
-       if (error)
+       if (!gtk_recent_manager_add_full (manager, document_uri, recent_data))
          {
            /* warn about the error */
          }
       around, so you must remember to free the data inside the list and then
       the list itself when you are done using it:
       <informalexample><programlisting>
+        GtkRecentManager *manager;
         GList *recent_items, *l;
 
+       manager = gtk_recent_manager_get_default(<!-- -->);
+
        recent_items = gtk_recent_manager_get_items (manager);
        for (l = recent_items; l != NULL; l = l-&gt;next)
          {
index 7d38e889331b0655ea12c77108d71776284aefbe..6266994fd8b62f29dfe36c500d8676225911507a 100644 (file)
@@ -29,15 +29,9 @@ file is as simple as:
 <informalexample>
   <programlisting>
 GtkRecentManager *manager;
-GError *error = NULL;
 
 manager = gtk_recent_manager_get_default ();
-gtk_recent_manager_add_item (manager, file_uri, &amp;error);
-if (error)
-  {
-    g_warning ("Could not add the file: &percnt;s", error-&gt;message);
-    g_error_free (error);
-  }
+gtk_recent_manager_add_item (manager, file_uri);
   </programlisting>
 </informalexample>
 
@@ -129,7 +123,6 @@ The #GQuark used for #GtkRecentManagerError errors.
 @GTK_RECENT_MANAGER_ERROR_INVALID_MIME: 
 @GTK_RECENT_MANAGER_ERROR_INVALID_ENCODING: 
 @GTK_RECENT_MANAGER_ERROR_NOT_REGISTERED: 
-@GTK_RECENT_MANAGER_ERROR_BAD_EXEC_STRING: 
 @GTK_RECENT_MANAGER_ERROR_READ: 
 @GTK_RECENT_MANAGER_ERROR_WRITE: 
 @GTK_RECENT_MANAGER_ERROR_UNKNOWN: 
@@ -175,7 +168,6 @@ The #GQuark used for #GtkRecentManagerError errors.
 
 @manager: 
 @uri: 
-@error: 
 @Returns: 
 
 
@@ -187,7 +179,6 @@ The #GQuark used for #GtkRecentManagerError errors.
 @manager: 
 @uri: 
 @recent_data: 
-@error: 
 @Returns: